package com.jiuyue.movehouse.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiuyue.movehouse.annotion.PageInfo;
import com.jiuyue.movehouse.entity.Car;
import com.jiuyue.movehouse.entity.ExtInfo;
import com.jiuyue.movehouse.entity.User;
import com.jiuyue.movehouse.service.ExtInfoService;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yourFather
 * @since 2022-02-11
 */
@RestController
@RequestMapping("/ext-info")
@AllArgsConstructor
public class ExtInfoController {

    private ExtInfoService extInfoService;

    @GetMapping("getExtInfoList")
    public List<ExtInfo> getExtInfoList( ) {
        return extInfoService.getExtInfoList();
    }

    @PostMapping("saveExtInfo")
    public void saveExtInfo(@RequestBody @Validated(ExtInfo.Save.class) ExtInfo extInfo) {
        extInfoService.saveExtInfo(extInfo);
    }

    @PutMapping("updateExtInfo")
    public void updateExtInfo(@RequestBody @Validated(ExtInfo.Update.class) ExtInfo extInfo) {
        extInfoService.updateExtInfo(extInfo);
    }

    @DeleteMapping("deleteExtInfo/{extInfoId}")
    public void deleteExtInfo(@PathVariable Long extInfoId) {
        extInfoService.deleteExtInfo(extInfoId);
    }

}

